<?php
/**
 * 文章详情的信息
 * Author: lyun
 * Date: 2018/2/2
 * Created by Panxsoft.
 */


namespace App\Http\Controllers\Home;

use App\Http\Models\Article;
use App\Services\Utils\ApiChecker;
use App\Services\Utils\ApiResponser;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class NewsController extends Controller
{
    use ApiResponser,ApiChecker;

    /**
     * @param $id
     * @return array|\Illuminate\Http\Response
     */
    public function show($id)
    {
        $article = Article::find($id);
            $this->checkItemExist($article, '文章');

        return $this->response(compact('article'));
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function returnView()
    {
        return view("official_website.news_detail");
    }
}
